﻿<UserControl x:Class="WpfApp.UserControls.Batches"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
             xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
             xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
             dx:ThemeManager.ThemeName="Office2007Blue"
             mc:Ignorable="d" 
             d:DesignHeight="400" d:DesignWidth="690">
    <Grid x:Name="GridMain" Margin="10,10,10,10">
        <Grid x:Name="GridBatch" Height="160" VerticalAlignment="Top">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
            </Grid.RowDefinitions>
            <!--Первый столбец - Labels-->
            <Label Grid.Column="0" Grid.Row="0" Content="Дата изготовления: " VerticalAlignment="Center" Margin="0,0,5,10" />
            <Label Grid.Column="0" Grid.Row="1" Content="Наименование: " VerticalAlignment="Center" Margin="0,0,5,10" />
            <Label Grid.Column="0" Grid.Row="2" Content="Номер партии: " VerticalAlignment="Center" Margin="0,0,5,10" />
            <Label Grid.Column="0" Grid.Row="3" Content="Количество: " VerticalAlignment="Center" Margin="0,0,5,10" />
            <Label Grid.Column="0" Grid.Row="4" Content="Мастер: " VerticalAlignment="Center" Margin="0,0,5,10" />
            <!--Второй столбец - Controls-->
            <dxe:DateEdit Grid.Column="1" Grid.Row="0" x:Name="EditDateOfManufacture" Margin="0,0,0,10" MinWidth="150" MaxWidth="200" Width="200" MaxLength="10" ToolTip="Введите дату изготовления" />
            <dxe:ComboBoxEdit Grid.Column="1" Grid.Row="1" x:Name="EditProductName" Margin="0,0,0,10" MinWidth="150" MaxWidth="200" Width="200" DisplayMember="ProductName" ValueMember="ID_Product" />
            <dxe:TextEdit Grid.Column="1" Grid.Row="2" x:Name="EditBatchNumber" Margin="0,0,0,10" MinWidth="150" MaxWidth="200" Width="200" />
            <dxe:PopupCalcEdit Grid.Column="1" Grid.Row="3" x:Name="EditQuantity" Margin="0,0,0,10" MinWidth="150" MaxWidth="200" Width="200" />
            <dxe:ComboBoxEdit Grid.Column="1" Grid.Row="4" x:Name="EditForeman" Margin="0,0,0,10" MinWidth="150" MaxWidth="200" Width="200" DisplayMember="Name" ValueMember="ID_Employee" />
            <!--Третий столбец - Labels-->
            <Label Grid.Column="2" Grid.Row="1" Content="Вид тары: " VerticalAlignment="Center" Margin="15,0,5,10" />
            <Label Grid.Column="2" Grid.Row="3" Content="Единица измерения: " VerticalAlignment="Center" Margin="15,0,5,10" />
            <Label Grid.Column="2" Grid.Row="4" Content="Лаборант: " VerticalAlignment="Center" Margin="15,0,5,10" />
            <!--Четвертый столбец - Controls-->
            <dxe:ComboBoxEdit Grid.Column="3" Grid.Row="1" x:Name="EditTypeOfPackaging" Margin="0,0,0,10" MinWidth="150" MaxWidth="200" Width="200" DisplayMember="PackagingName" ValueMember="ID_Packaging" />
            <dxe:ComboBoxEdit Grid.Column="3" Grid.Row="3" x:Name="EditUnit" Margin="0,0,0,10" MinWidth="150" MaxWidth="200" Width="200" ValueMember="ID_Unit" DisplayMember="UnitName" />
            <dxe:ComboBoxEdit Grid.Column="3" Grid.Row="4" x:Name="EditAnalyst" Margin="0,0,0,10" MinWidth="150" MaxWidth="200" Width="200" ValueMember="ID_Employee" DisplayMember="Name" />
        </Grid>
        <Grid x:Name="GridParameters" Margin="0,160,0,0">
            <Grid.RowDefinitions>
                <RowDefinition Height="*"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
            </Grid.RowDefinitions>
            <dxg:GridControl Grid.Row="0" HorizontalAlignment="Stretch" x:Name="gridParameters" AutoPopulateColumns="True" VerticalAlignment="Top" MaxHeight="600">
                <dxg:GridControl.View>
                    <dxg:TableView x:Name="tableParameters" ShowTotalSummary="False" BestFitMode="VisibleRows" AllowBestFit="True" BestFitArea="Rows" AutoWidth="True" ShowGroupPanel="False" />
                </dxg:GridControl.View>
            </dxg:GridControl>
            
            <Button Content="Сохранить" Grid.Row="1" HorizontalAlignment="Left" Margin="0,10,0,0" Name="buttonSave" Width="100" Height="23" VerticalAlignment="Top" />
            <Button Content="Закрыть" Grid.Row="1" HorizontalAlignment="Left" Margin="110,10,0,0" Name="buttonClose" Width="100" Height="23" VerticalAlignment="Top" />
        </Grid>
    </Grid>
</UserControl>
